/**
 * 
 */
package com.eop.entity;

import java.util.Date;
import java.util.Set;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * 应急事件
 * 
 * @author ld
 * 
 */
@Entity
@Table(name = "eop_Event")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@NamedQueries( {
		@NamedQuery(name = "sr.getEvent", query = "from Event as sr where sr.eventHappenDate>=? and sr.eventHappenDate<=? and sr.event_DelFlag=false order by eventCreateDate desc"),
		@NamedQuery(name = "sr.getEventByName", query = "from Event as sr where sr.eventName like ? and sr.event_DelFlag=false order by eventCreateDate desc"),
		@NamedQuery(name = "sr.getAllEffectEvent", query = "from Event where event_DelFlag=false order by eventCreateDate desc") })
public class Event {
	/**
	 * ID
	 */
	@Id
	private String id;

	/**
	 * 编码
	 */
	private String eventCode;

	/**
	 * 名称
	 */
	private String eventName;

	/**
	 * 响应级别
	 */
	private String eventLevel;

	/**
	 * 事件发生时间
	 */
	private Date eventHappenDate;

	/**
	 * 上报时间
	 */
	private Date eventReportDate;

	/**
	 * 地址
	 */
	private String eventAddress;

	/**
	 * 备注
	 */
	@Basic(fetch = FetchType.LAZY)
	@Column(columnDefinition = "text")
	private String eventRemark;

	/**
	 * 事件状态
	 */
	private String eventStatus;

	/**
	 * 创建者
	 */
	private String eventCreateUser;

	/**
	 * 创建时间
	 */
	private Date eventCreateDate;

	/**
	 * 更新者
	 */
	private String eventUpdateUser;

	/**
	 * 更新时间
	 */
	private Date eventUpdateDate;

	/**
	 * 归档时间
	 */
	private Date eventHistoryDate;

	/**
	 * 适用范围大类
	 */
	private String eventRangeB;

	/**
	 * 适用范围细类
	 */
	private String eventRangeS;

	/**
	 * 是否删除 0 未删除 1 删除
	 */
	private boolean event_DelFlag;

	/**
	 * 是否为历史案例
	 */
	private boolean eventHistoryFlag;

	@OneToMany(mappedBy = "siEvent", cascade = CascadeType.REMOVE, fetch = FetchType.LAZY)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	private Set<SpecialInfor> sInfo;

	@OneToMany(mappedBy = "esEvent", cascade = CascadeType.REMOVE, fetch = FetchType.LAZY)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	private Set<EmergencyStage> egs;

	@OneToMany(mappedBy = "siEvent", cascade = CascadeType.REMOVE, fetch = FetchType.LAZY)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	private Set<Minutes> minutes;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getEventCode() {
		return eventCode;
	}

	public void setEventCode(String eventCode) {
		this.eventCode = eventCode;
	}

	public String getEventName() {
		return eventName;
	}

	public void setEventName(String eventName) {
		this.eventName = eventName;
	}

	public String getEventLevel() {
		return eventLevel;
	}

	public void setEventLevel(String eventLevel) {
		this.eventLevel = eventLevel;
	}

	public Date getEventHappenDate() {
		return eventHappenDate;
	}

	public void setEventHappenDate(Date eventHappenDate) {
		this.eventHappenDate = eventHappenDate;
	}

	public Date getEventReportDate() {
		return eventReportDate;
	}

	public void setEventReportDate(Date eventReportDate) {
		this.eventReportDate = eventReportDate;
	}

	public String getEventAddress() {
		return eventAddress;
	}

	public void setEventAddress(String eventAddress) {
		this.eventAddress = eventAddress;
	}

	public String getEventRemark() {
		return eventRemark;
	}

	public void setEventRemark(String eventRemark) {
		this.eventRemark = eventRemark;
	}

	public String getEventStatus() {
		return eventStatus;
	}

	public void setEventStatus(String eventStatus) {
		this.eventStatus = eventStatus;
	}

	public String getEventCreateUser() {
		return eventCreateUser;
	}

	public void setEventCreateUser(String eventCreateUser) {
		this.eventCreateUser = eventCreateUser;
	}

	public Date getEventCreateDate() {
		return eventCreateDate;
	}

	public void setEventCreateDate(Date eventCreateDate) {
		this.eventCreateDate = eventCreateDate;
	}

	public String getEventUpdateUser() {
		return eventUpdateUser;
	}

	public void setEventUpdateUser(String eventUpdateUser) {
		this.eventUpdateUser = eventUpdateUser;
	}

	public Date getEventUpdateDate() {
		return eventUpdateDate;
	}

	public void setEventUpdateDate(Date eventUpdateDate) {
		this.eventUpdateDate = eventUpdateDate;
	}

	public Date getEventHistoryDate() {
		return eventHistoryDate;
	}

	public void setEventHistoryDate(Date eventHistoryDate) {
		this.eventHistoryDate = eventHistoryDate;
	}

	public String getEventRangeB() {
		return eventRangeB;
	}

	public void setEventRangeB(String eventRangeB) {
		this.eventRangeB = eventRangeB;
	}

	public String getEventRangeS() {
		return eventRangeS;
	}

	public void setEventRangeS(String eventRangeS) {
		this.eventRangeS = eventRangeS;
	}

	public boolean isEvent_DelFlag() {
		return event_DelFlag;
	}

	public void setEvent_DelFlag(boolean eventDelFlag) {
		event_DelFlag = eventDelFlag;
	}

	public boolean isEventHistoryFlag() {
		return eventHistoryFlag;
	}

	public void setEventHistoryFlag(boolean eventHistoryFlag) {
		this.eventHistoryFlag = eventHistoryFlag;
	}

	public Set<SpecialInfor> getsInfo() {
		return sInfo;
	}

	public void setsInfo(Set<SpecialInfor> sInfo) {
		this.sInfo = sInfo;
	}

	public Set<EmergencyStage> getEgs() {
		return egs;
	}

	public void setEgs(Set<EmergencyStage> egs) {
		this.egs = egs;
	}

	public Set<Minutes> getMinutes() {
		return minutes;
	}

	public void setMinutes(Set<Minutes> minutes) {
		this.minutes = minutes;
	}

}
